<?
include('inc_security.php');

$type       = getValue('type', 'str', 'GET', '');
$record_id  = getValue('record_id');
$redirect   = getValue('redirect', 'str', 'GET', '');
if ($redirect != '')
{
    $redirect = base64_decode($redirect);
}
else
{
    $redirect = 'listing.php';
}

$arrQuickSet = array('active' => 'bra_active');
if (isset($arrQuickSet[$type]))
{
    $db_update = new db_execute('UPDATE ' . $gs_table . ' SET ' . $arrQuickSet[$type] . ' = IF(' . $arrQuickSet[$type] . ' = 1, 0, 1) WHERE ' . $id_field . ' = ' . $record_id . ' AND lang_id = ' . $lang_id);
    unset($db_update);
}

redirect($redirect);
?>